/*
	
	Alfred.h

	Alfred is the alias for the AI implementation
*/

#include <stdlib.h>	
#include <time.h>
#include "Game.h"

#define MAX_INT 32767
#define MIN_INT -32767

enum Difficulty {MEDIUM, HARD, EASY };

class Alfred
{
	Game* game;
	Difficulty diff;
	char piece;

public:
	Alfred(Game* g): game(g), piece(BLACK)
    {
    	diff = EASY;
        // initialize random seed
        srand(time(NULL));
    };

	Alfred(Difficulty d, char p, Game* g):  game(g), piece(p)
	{
		diff = d;
		// initialize random seed
		srand(time(NULL));
	};
	

	// generic function to move to correct calculation of move
	void move();
	void toggle_piece();
	void set_difficulty(Difficulty dif);

	// called to get random numbers (1 - 15)
	const Move random_move();
	
	const Move smart_move(const int depth);	
    Move random_move(Game game);

    int Minimax(Node node, int alpha, int beta, int depth, char player);

    int runs_check(const Board board, int r, int c, int xs, int ys, char p);
    int runs_score(const Board board, char p);

    int evaluate(Board board, char piece);
    char swap(const char p);
};
